import Vue from 'vue'
import Router from 'vue-router'
import Tabs from '@/components/tab/Tabs.vue'
import Dashboard from '@/components/layout/Dashboard.vue'
import Home from '@/components/home/Home.vue'
import News from '@/components/news/News.vue'
import List from '@/components/list/List.vue'
import testInput from '@/components/list/testInput.vue'
import innerInput from '@/components/list/innerInput.vue'
import innerList from '@/components/list/innerList.vue'
import Config from 'components/config/Config.vue'//表单拖拽

Vue.use(Router)

export default new Router({
    routes:[
        {
            path:'/',
            component:Dashboard,
            children:[
                { path: '/', redirect:'/dashboard'},
                { path: '/dashboard', component: Tabs},
                { path: '/tableconfig', component: Config}
            ],
            meta:{keepAlive:false}
        },
        {
            path:'/home',
            component:Home
        },
        {
            path:'/config',
            component:Config
        },
        {
            path:'/news',
            component:News,
            meta:{keepAlive:false}
        },
        {
            path:'/list',
            component:List,
            meta:{keepAlive:false}
        },
        {
            path:'/testinput',
            component:testInput,
            redirect:'/testinput/innerList',
            children:[
                { path: '/testinput/innerList', component: innerList},
                { path: '/testinput/innerInput', component: innerInput}
            ]
        },
        {
            path:'*',
            redirect:'/dashboard'
        }
    ],
    mode:'history',
    scrollBehavior:()=>({
        y:0
    })
})

